package Command_Pattern.Calculator;


import java.util.ArrayList;

// -*-coding:utf-8 -*-
//人员：刘陆鑫
//班级：19软3
//学号；2019110218
public class CommandQueue {
    private int value;
    private ArrayList<AddCommand> commands=new ArrayList<AddCommand>();
    public void add_Command(AddCommand addCommand){
        commands.add(addCommand);
    }
    public void removeCommand( AddCommand addCommand){
        commands.remove(commands);
    }
    public void execute() {
        for (Object addCommand : commands) {
            ((AddCommand) addCommand).redo();
        }
    }
}
